andl $~3,reg; \
movl (reg),reg;
-#define HVM_MONITOR_EFLAGS 0x202 /* IF on */
-#define NR_SKIPPED_REGS 7 /* Skip SS thru EAX */
-#define HVM_SAVE_ALL_NOSEGREGS \
- pushl $HVM_MONITOR_EFLAGS; \
- popf; \
- subl $(NR_SKIPPED_REGS*4),%esp; \
- pushl %ebp; \
- pushl %edi; \
- pushl %esi; \
- pushl %edx; \
- pushl %ecx; \
- pushl %ebx;
-
#define VMRUN .byte 0x0F,0x01,0xD8
#define STGI .byte 0x0F,0x01,0xDC
#define CLGI .byte 0x0F,0x01,0xDD
ENTRY(svm_asm_do_resume)
GET_CURRENT(%ebx)
- cli # tests must not race interrupts
+ CLGI
movl VCPU_processor(%ebx),%eax
shl $IRQSTAT_shift,%eax
testl $~0,irq_stat(%eax,1)
call svm_intr_assist
call svm_load_cr2
- CLGI
- sti
- GET_CURRENT(%ebx)
movl VCPU_svm_vmcb(%ebx),%ecx
movl UREGS_eax(%esp),%eax
movl %eax,VMCB_rax(%ecx)
popl %esi
popl %edi
popl %ebp
- addl $(NR_SKIPPED_REGS*4),%esp
VMRUN
- HVM_SAVE_ALL_NOSEGREGS
+ pushl %ebp
+ pushl %edi
+ pushl %esi
+ pushl %edx
+ pushl %ecx
+ pushl %ebx
GET_CURRENT(%ebx)
movb $0,VCPU_svm_vmcb_in_sync(%ebx)
ALIGN
svm_process_softirqs:
- sti
+ STGI
call do_softirq
jmp svm_asm_do_resume
andq $~7,reg; \
movq (reg),reg;
-#define HVM_MONITOR_RFLAGS 0x202 /* IF on */
-#define NR_SKIPPED_REGS 6 /* Skip SS thru error_code */
-#define HVM_SAVE_ALL_NOSEGREGS \
- pushq $HVM_MONITOR_RFLAGS; \
- popfq; \
- subq $(NR_SKIPPED_REGS*8),%rsp; \
- pushq %rdi; \
- pushq %rsi; \
- pushq %rdx; \
- pushq %rcx; \
- pushq %rax; \
- pushq %r8; \
- pushq %r9; \
- pushq %r10; \
- pushq %r11; \
- pushq %rbx; \
- pushq %rbp; \
- pushq %r12; \
- pushq %r13; \
- pushq %r14; \
- pushq %r15;
-
#define VMRUN .byte 0x0F,0x01,0xD8
#define STGI .byte 0x0F,0x01,0xDC
#define CLGI .byte 0x0F,0x01,0xDD
ENTRY(svm_asm_do_resume)
GET_CURRENT(%rbx)
- cli # tests must not race interrupts
+ CLGI
movl VCPU_processor(%rbx),%eax
shl $IRQSTAT_shift,%rax
leaq irq_stat(%rip),%rdx
call svm_intr_assist
call svm_load_cr2
- CLGI
- sti
- GET_CURRENT(%rbx)
movq VCPU_svm_vmcb(%rbx),%rcx
movq UREGS_rax(%rsp),%rax
movq %rax,VMCB_rax(%rcx)
popq %rdx
popq %rsi
popq %rdi
- addq $(NR_SKIPPED_REGS*8),%rsp
VMRUN
- HVM_SAVE_ALL_NOSEGREGS
+ pushq %rdi
+ pushq %rsi
+ pushq %rdx
+ pushq %rcx
+ pushq %rax
+ pushq %r8
+ pushq %r9
+ pushq %r10
+ pushq %r11
+ pushq %rbx
+ pushq %rbp
+ pushq %r12
+ pushq %r13
+ pushq %r14
+ pushq %r15
GET_CURRENT(%rbx)
movb $0,VCPU_svm_vmcb_in_sync(%rbx)
ALIGN
svm_process_softirqs:
- sti
+ STGI
call do_softirq
jmp svm_asm_do_resume